package com.leapcloud.crm.core.exception;

/**
 * @author wangzhenyan
 * @email ffu@maxleap.com
 * @since 2018/8/28 13:18
 */
public class ImsException extends RuntimeException {

  private int code = 400;
  private String msg = "fail";
  private Object data;

  public ImsException(String msg) {
    super(msg);
    this.msg = msg;
  }

  public ImsException(Throwable cause) {
    super(cause.getMessage(), cause);
    this.msg = cause.getMessage();
  }

  public ImsException(int code, String msg) {
    super(msg);
    this.code = code;
    this.msg = msg;
  }

  public ImsException(int code, String msg, Object data) {
    super(msg);
    this.code = code;
    this.msg = msg;
    this.data = data;
  }

  public ImsException(int code, Throwable cause) {
    super(cause);
    this.code = code;
    this.msg = cause.getMessage();
  }

  public ImsException(String message, Throwable cause) {
    super(message, cause);
    this.msg = message;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }


  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public Object getData() {
    return data;
  }

  public void setData(Object data) {
    this.data = data;
  }
}
